home *** CD-ROM | disk | FTP | other *** search
/ Autodesk Animator Studio / Autodesk Animator Studio.iso / player / setup.mst < prev    next >
Text File  |  1995-09-12  |  12KB  |  303 lines

  1. '**************************************************************************
  2. '*                  VfW 1.1 Runtime Setup
  3. '**************************************************************************
  4. '$INCLUDE 'setupapi.inc'
  5. '$INCLUDE 'mscpydis.inc'    ''System
  6. '$INCLUDE 'msdetect.inc'    ''Detects Avalilable Disk Space
  7.  
  8. GLOBAL Destination$        ''Default destination directory.
  9.  
  10. ''Dialog ID's
  11. CONST SUCCESSFUL_DIALOG =         2701
  12. CONST SUCCESSFUL_RESTART_DIALOG = 2700
  13. CONST FAILED_DIALOG =             107
  14. CONST GET_DRIVE_DIALOG =          101
  15. CONST APPHELP =                   106
  16.  
  17. ''Bitmap ID
  18. CONST LOGO = 999
  19.  
  20. CONST CURVER$= "Release 1.1"
  21.  
  22. GLOBAL SizeReq&  '' Total Disk Size required for installation
  23.  
  24. ''File Types
  25. GLOBAL WinDir$
  26. GLOBAL WinSysDir$
  27. GLOBAL WinSys32Dir$
  28. GLOBAL WINDRIVE$    ''Windows Drive Letter.
  29. GLOBAL CHECKSTATES$
  30. GLOBAL MinorVer%
  31. GLOBAL OnNT$
  32.  
  33. DECLARE SUB Install
  34. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  35. DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
  36. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  37. DECLARE SUB Reboot LIB "iniupd.dll"
  38. DECLARE fUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  39.  
  40. INIT:
  41.   
  42.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  43.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  44.     
  45.     if DoesiniKeyExist ("WIN.INI", "AnimatorStudio", "Location") THEN 
  46.         Destination$= GetiniKeyString("WIN.INI", "AnimatorStudio", "Location")
  47.     else
  48.         Destination$= "c:\animator"
  49.     ENDIF
  50.   
  51.     SetSymbolValue "DestinationDrive", Destination$
  52.     SetSymbolValue "VersionNumber", CURVER$
  53.     
  54.     WIN32ENABLED% = 0
  55.     MajorVer% = GetWindowsMajorVersion()
  56.     MinorVer% = GetWindowsMinorVersion()
  57.     Processor% = GetProcessorType()
  58.     WinDir$ = GetWindowsDir()
  59.     DEST$ = GetWindowsDir()
  60.     WinSysDir$ = GetWindowsSysDir()
  61.     WinSys32Dir$ = WinDir$ + "system32"
  62.  
  63.     IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
  64.     i% = DoMsgBox("Microsoft Windows version 3.10 or greater is required for this software.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  65.     END
  66.     END IF
  67.  
  68.     'Prevents installation on 286
  69.     IF Processor% < 3 THEN
  70.     i% = DoMsgBox("Video for Windows requires a 386 or greater processor or emulator.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  71.     END
  72.     END IF
  73.  
  74.     ' Use Wowexec to determine version of NT.  3.1 did not stamp wowexec and wow returns 3.1 as version
  75.     IF OnWindowsNT() THEN
  76.       OnNT$ = "TRUE"
  77.       WowVersion$ = GetVersionOfFile(WinSys32Dir$ + "\wowexec.exe")
  78.       IF WowVersion$ = "" THEN
  79.          i% = DoMsgBox("Video for Windows does not run on Windows NT 3.1.  Please upgrade your version of Windows.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  80.          END
  81.       END IF
  82.     END IF
  83.  
  84.     SetBitmap CUIDLL$, LOGO
  85.     SetTitle "Autodesk Animator Player Setup"
  86.  
  87.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  88.     IF szInf$ = "" THEN
  89.        szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
  90.     END IF
  91.     ReadInfFile szInf$
  92.  
  93.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  94.  
  95. WELCOME:
  96.     sz$ = UIStartDlg(CUIDLL$, GET_DRIVE_DIALOG, "FCheckDlgProc", APPHELP, HELPPROC$)
  97.     IF sz$ = "CONTINUE" THEN
  98.        UIPop 1
  99.      ELSE
  100.     GOSUB ASKQUIT
  101.     GOTO WELCOME
  102.     END IF
  103.  
  104. ''Prepare Copy list and check size
  105.  
  106.     ClearCopyList
  107.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  108.     
  109. '' Get Destination Drive
  110.     Destination$= GetSymbolValue("DestinationDrive")
  111.  
  112.     AddSectionFilesToCopyList "AnimPlay", SrcDir$, Destination$
  113.     AddSectionFilesToCopyList "ALL", SrcDir$, Destination$
  114.     AddSectionFilesToCopyList "OLE2", SrcDir$, WinSysDir$
  115.     AddSectionFilesToCopyList "ExtraHandlers", SrcDir$, WinSysDir$
  116.     AddSectionFilesToCopyList "VfWRuntime", SrcDir$, WinSysDir$
  117.     AddSectionFilesToCopyList "ACMDrivers", SrcDir$, WinSysDir$
  118.     AddSectionFilesToCopyList "AVICodecs", SrcDir$, WinSysDir$
  119.  
  120. ''*************************************************************************************************************************
  121. ''*************************************************************************************************************************
  122. ''To add a DCI provider, please un-comment the AddSectionFilesToCopyList,
  123. ''and add a "DCI Provider" section with to the SETUP.INF file.
  124. ''
  125. ''      AddSectionFilesToCopyList "DCI Provider", SrcDir$, WinSysDir$
  126. ''*************************************************************************************************************************
  127. ''*************************************************************************************************************************
  128.  
  129. Install
  130.  
  131. '' Restart Windows: if it has to updates ACM from DOS, it restarts Windows automatically
  132. '' else, it gives the user the choice
  133.     RESTRT% = RestartListEmpty ()
  134.     Exe$ = DEST$ + "\_msrstrt.exe"
  135.     Batch$ = DEST$ + "\_mssetup.bat"
  136.     empty$ = ""
  137. RESTART:
  138.     IF RESTRT% = 0 THEN
  139.        sz$ = UIStartDlg(CUIDLL$, SUCCESSFUL_DIALOG, "FInfoDlgProc", 0, "")
  140.        IF sz$ = "REACTIVATE" THEN
  141.       GOTO RESTART
  142.        ENDIF
  143.        I% = ExitExecRestart ()
  144.        RemoveFile Exe$, cmoForce
  145.        RemoveFile Batch$, cmoForce
  146.        END
  147.     ELSE
  148.        sz$ = UIStartDlg(CUIDLL$, SUCCESSFUL_RESTART_DIALOG, "FQuitDlgProc", 0, "")
  149.        IF sz$ = "CONTINUE" OR sz$ = "GO ON" THEN
  150.       I% = ExitWindowsExec (Exe$, empty$)
  151.       END
  152.       IF I% = 0 THEN
  153.          GOTO RESTART
  154.       ELSE
  155.          END
  156.      ENDIF
  157.        ELSEIF sz$ = "EXIT" THEN
  158.       UIPopAll
  159.       END
  160.        ELSEIF sz$ = "REACTIVATE" THEN
  161.       GOTO RESTART
  162.        ELSE
  163.       UIPopAll
  164.       END
  165.        END IF
  166.     END IF
  167.  
  168.  
  169. QUIT:
  170.     ON ERROR GOTO ERRQUIT
  171.  
  172.     IF ERR = 0 THEN
  173.     dlg% = EXITSUCCESS
  174.     ELSEIF ERR = STFQUIT THEN
  175.     dlg% = EXITQUIT
  176.     ELSE
  177.     dlg% = EXITFAILURE
  178.     END IF
  179. QUITL1:
  180.     sz$ = UIStartDlg(CUIDLL$, FAILED_DIALOG, "FInfoDlgProc", 0, "")
  181.     IF sz$ = "REACTIVATE" THEN
  182.     GOTO QUITL1
  183.     END IF
  184.     UIPop 1
  185.     END
  186.  
  187. ERRQUIT:
  188.     i% = DoMsgBox("An installation problem occured, call the product support service", "Setup Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  189.     END
  190.  
  191.  
  192. ASKQUIT:
  193.     UIPopAll
  194.     END
  195. REM    sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  196.  
  197.     IF sz$ = "EXIT" THEN
  198.     UIPopAll
  199. ''        ERROR STFQUIT
  200.     END
  201.     ELSEIF sz$ = "REACTIVATE" THEN
  202.     GOTO ASKQUIT
  203.     ELSE
  204.     UIPop 1
  205.     END IF
  206.     RETURN
  207.  
  208. '**
  209. '** Purpose:
  210. '**     Performs all installation operations.
  211. '** Arguments:
  212. '**     none.
  213. '** Returns:
  214. '**     none.
  215. '*************************************************************************
  216. SUB Install STATIC
  217.  
  218.     SetRestartDir WinDir$
  219.     CopyFilesInCopyList
  220.  
  221. ''Updating WIN.INI and SYSTEM.INI
  222. ''Only update SYSTEM.INI  on NT or next version of Windows for other codecs
  223.  
  224.    CreateProgmanGroup "Autodesk Multimedia", "", cmoNone
  225.    ShowProgmanGroup  "Autodesk Multimedia", 1, cmoNone
  226.    CreateProgmanItem "Autodesk Multimedia", "Animator Player", MakePath(Destination$, "player.exe"), "", cmoOverwrite
  227.    CreateProgmanItem "Autodesk Multimedia", "AAS Player Readme", "write.exe "+Destination$+"\player.wri", "", cmoOverwrite
  228.  
  229.    CreateIniKeyValue WinDir$ + "win.ini", "AnimatorStudio", "Location", Destination$, cmoOverwrite
  230.    CreateIniKeyValue WinDir$ + "win.ini", "AnimatorStudio", "PlayerInstall", CURVER$, cmoOverwrite
  231.  
  232. IF ((NOT OnNT$ = "TRUE") AND MinorVer% < 50) THEN
  233.     IF VflatdPresent() = 0 THEN
  234.        CreateSysIniKeyValue WinDir$ + "system.ini", "386Enh", "device", "dva.386", cmoOverwrite
  235.     END IF
  236. END IF
  237. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV32", "ir32.dll", cmoOverwrite
  238. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.IV31", "ir32.dll", cmoOverwrite
  239. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.RT21", "ir21.dll", cmoOverwrite
  240. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.YVU9", "iyvu9.dll", cmoOverwrite
  241. CreateIniKeyValue WinDir$ + "system.ini", "Drivers", "VIDC.CVID",